package com.kun.common;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultDto {

    private Integer code;
    private Object data;

    public static ResultDto  success(){
        return  new ResultDto(Constants.CODE_200,null);
    }

    public static ResultDto  success(Object data){
        return  new ResultDto(Constants.CODE_200,data);
    }

    public static ResultDto  fail(Integer code, Object data){
        return  new ResultDto(code,data);
    }

    public static ResultDto  fail(Object data){
        return  new ResultDto(Constants.CODE_300,data);
    }


}
